define(['egis'],
    function (egis) {
        Window.deserializer = Window.deserializer || new egis.core.Deserializer();
        Window.container = Window.container || {};
        dsBridge.register('create_PlotEditTool', function (sourceId, commandId, plotLayerId) {
            try {
                var plotLayer = Window.container[plotLayerId];
                var plotTool = new egis.plot.PlotEditTool({
                    id: commandId,
                    layer: plotLayer
                });
                Window.container[sourceId] = plotTool;
            }
            catch (e) {
                alert(e)
            }
        });

        dsBridge.register('PlotEditTool_onClick', function (sourceId) {
            try {
                var plotTool = Window.container[sourceId];
                if (!!plotTool) {
                    plotTool.onClick();
                }
            }
            catch (e) {
                alert(e)
            }
        });
    })